<?php
class Main_Function
{
	/**
	 * @param string $string
	 * @return string
	 */
	public static function encodePassword($string)
	{
		return md5($string);
	}
	
	/**
	 * @param array $list
	 * @param string $expandKey
	 * @param string|null $expandValue
	 * @return array
	 */
	public static function expandList($list, $expandKey, $expandValue = null)
	{
		$res = array();
		
		if (is_array($list)) {
			foreach ($list as $item) {
				$res[$item[$expandKey]] = (null == $expandValue) ? $item : $item[$expandValue];	
			}
		}
		
		return $res;
	}
	

}
